package com.sgb.kjwl.view.ui.adapter.pick;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.pick.PickHallSceneBidListEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class PickHallSceneBidAdapter extends BaseRecycleAdapter<PickHallSceneBidListEntity> {

    private ImageView img_jy;
    private LinearLayout region;
    private LinearLayout meetingPlatform;
    private LinearLayout meetingNo;

    public PickHallSceneBidAdapter(Context context, List<PickHallSceneBidListEntity> datas) {
        super(context, R.layout.item_pick_hall_scene, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final PickHallSceneBidListEntity entity) {
        holder.setBinding(BR.viewModel, entity);
        meetingNo = holder.itemView.findViewById(R.id.layout_meeting_no);
        meetingPlatform = holder.itemView.findViewById(R.id.layout_meeting_platform);
        region = holder.itemView.findViewById(R.id.layout_region);
        img_jy = holder.itemView.findViewById(R.id.img_jy);

        if (!TextUtils.isEmpty(entity.getBidMeetingPlatform())) {
            //网上
            meetingPlatform.setVisibility(View.VISIBLE);
        }else{
            meetingPlatform.setVisibility(View.GONE);
        }
        if (!TextUtils.isEmpty(entity.getBidMeetingNo())) {
            //网上
            meetingNo.setVisibility(View.VISIBLE);
        }else{
            meetingNo.setVisibility(View.GONE);
        }
        if (!TextUtils.isEmpty(entity.getRegion())) {
            //线下
            region.setVisibility(View.VISIBLE);
        }else{
            region.setVisibility(View.GONE);
        }

    }
}
